// 系统窗口管理器
import Window from './Window'
export default class WindowManage{
    // 窗口的最高优先级
    max_priority
    // 所有窗口
    windows
    // 置顶窗口
    constructor(){
        this.windows  = new Map()
        this.max_priority = 100
    }
    pushTheWinToFront(win){
        let now_priority = this.max_priority+1
        win.setPriority(now_priority)
        this.max_priority = now_priority
    }
    // 申请一个窗口
    applyWindow(processId = null){
        if(!processId) console.error('please bind processId for window')
        let win = new Window(processId,200,200,100,100)
        // 注册窗口
        this.windows.set(win.getWindowId(),win)
        return win
    }
}